#include <stdint.h>

#ifndef __SERIAL_H__
#define __SERIAL_H__

#if defined __cplusplus
extern "C" {
#endif

typedef enum
{
    E_SERIAL_OK,
    E_SERIAL_ERROR,
    E_SERIAL_NODATA,
} teSerial_Status;

teSerial_Status eSerial_Init( char *name, unsigned int baud, int *piserial_fd );

teSerial_Status eSerial_Read( unsigned char *data );

teSerial_Status eSerial_Write( const unsigned char data );

teSerial_Status eSerial_ReadBuffer( unsigned char *data, unsigned int *count );

teSerial_Status eSerial_WriteBuffer( unsigned char *data, unsigned int count );

teSerial_Status eSerial_Close( void );

#if defined __cplusplus
}
#endif

#endif /* __SERIAL_H__ */